package com.itbaizhan.service;

import com.itbaizhan.Container;
import com.itbaizhan.dao.StudentDao;
import com.itbaizhan.dao.StudentDaoImpl;
import com.itbaizhan.domain.Student;

import java.awt.*;

public class StudentService {
    public Student findStudentById(int id){
        //这是调用者取获对象
       /* StudentDao studentDao = new StudentDaoImpl();
        return studentDao.findById(id);*/
        //从容器中获取对象
        StudentDao studentDao =(StudentDao) Container.getBean("studentDao");
        System.out.println(studentDao.hashCode());
        return studentDao.findById(id);
    }
}
